<?php
class TreeGetRewardAction extends SzAbstractAction
{
    Protected $paramTypes = array(
        SzAbstractAction::TYPE_INT,
        SzAbstractAction::TYPE_INT,
        SzAbstractAction::TYPE_INT,
    );

    /**
     * @param $userId
     * @param $buildingId
     * @param $reqTime
     * @return SzResponse
     * @throws SzException
     */
    public function execute($userId,$buildingId,$reqTime) {
        if (!GameService::get()->verifySysUnlock($userId, GameConst::FUNC_TREE)) {
            return $this->buildResponse(false);
        }

        GameService::get()->validateMultiRequestTimeDelta($userId, $reqTime);

        return $this->buildResponse(array(
           'status' => TreeService::get()->getReward($userId,$buildingId,$reqTime)
        ));
    }
}